package main

import (
	"fmt"
	"strconv"
	"time"
)

func test() {
	for i := 0; i < 10; i++ {
		fmt.Println("hello golang +", strconv.Itoa(i))
		//阻塞一秒钟
		time.Sleep(time.Second)
	}
}
func main() { //主线程
	//第十二章：go语言的协程和管道
	go test() //开启一个协程
	for i := 0; i < 5; i++ {
		fmt.Println("hello main +", strconv.Itoa(i))
		//阻塞一秒钟
		time.Sleep(time.Second)
	}
}
